<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link href="<%=basePath %>front/css/bootstrap.css" rel="stylesheet" type="text/css" media="all" />
<link rel="stylesheet" type="text/css" href="<%=basePath %>front/css/table-style.css" />
<link rel="stylesheet" type="text/css" href="<%=basePath %>front/css/basictable.css" />
<link href="<%=basePath %>front/css/component.css" rel="stylesheet" type="text/css" media="all" />
<link href="<%=basePath %>front/css/style_grid.css" rel="stylesheet" type="text/css" media="all" />
<link href="<%=basePath %>front/css/style.css" rel="stylesheet" type="text/css" media="all" />
<!-- font-awesome-icons -->
<link href="<%=basePath %>front/css/font-awesome.css" rel="stylesheet"> 
<!-- //font-awesome-icons -->
<link href="http://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i,800" rel="stylesheet">
</head>
<body>
<!-- banner -->
<div class="wthree_agile_admin_info">
<jsp:include page="top.jsp"></jsp:include>
		 
		<div class="clearfix"></div>
		
				<div class="inner_content">
				    

					<div class="inner_content_w3_agile_info two_in">
					  
									
									<div class="agile-tables">
										<div class="w3l-table-info agile_info_shadow">
										 <h3 class="w3_inner_tittle two">我的奖品</h3>
											<table id="table">
											<thead>
											  <tr>
												<th>序号</th>
												<th>奖品名称</th>
												<th></th>
												<th></th>
												<th></th>
												<th>获得时间</th>
											  </tr>
											</thead>
											<tbody id="myPrizeList">
											  <tr>
												<td>1</td>
												<td>呵呵</td>
												<td></td>
												<td></td>
												<td></td>
												<td>2020-01-01</td>
											  </tr>
											  <tr>
												<td>1</td>
												<td>呵呵</td>
												<td></td>
												<td></td>
												<td></td>
												<td>2020-01-01</td>
											  </tr><tr>
												<td>1</td>
												<td>呵呵</td>
												<td></td>
												<td></td>
												<td></td>
												<td>2020-01-01</td>
											  </tr><tr>
												<td>1</td>
												<td>呵呵</td>
												<td></td>
												<td></td>
												<td></td>
												<td>2020-01-01</td>
											  </tr><tr>
												<td>1</td>
												<td>呵呵</td>
												<td></td>
												<td></td>
												<td></td>
												<td>2020-01-01</td>
											  </tr>
											</tbody>
										  </table>
									
									 
								</div>
								
									 
								
									
						</div>
							<!-- //tables -->
					
						



</body>
</html>
<script>
$(document).ready(function(){
	showAll();
});
	function showAll(){
		debugger;
		var everything =document.getElementById("everything").value;
		
		var l = document.getElementById("myPrizeList");
		l.innerHTML='';
		$.ajax( {
						url:'<%=basePath%>myprize/findAll',
						async: false,
						type:'post',
						data: {
							
						},
						datatype : "json",//"xml", "html", "script", "json", "jsonp", "text".           
						success : function(data) {
							var json=eval('(' + data + ')');
							$.each(json, function (n, item) {
								if(item.prize.indexOf(everything)>=0){
									addGift(n,item);
								}
								
							});
						},
						error : function() {
			                alert("异常！！！");
			                selAllFriend();	
			            }
				});
	}
	function addGift(n,item){
		var val = "<tr>"+
			"<td>"+(n+1)+"</td>"+
			"<td>"+item.prize+"</td>"+
			"<td></td>"+
			"<td></td>"+
			"<td></td>"+
			"<td>"+item.createtime+"</td>"+
		  "</tr>";

		$("#myPrizeList").append(val);
	}
</script>